package HomeWork;

import java.util.Scanner;

/*
定义功能，计算出数组中指定元素出现的次数。

	数组: int[] arr = {1,43,43,5,4,6,6,7,7,88,9,9,9,0,0,9};

	指定元素: int x = 9;
 */
public class Extra04 {
    public static void main(String[] args) {
        int[] arr = {1,43,43,5,4,6,6,7,7,88,9,9,9,0,0,9};
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();

        int count = count(arr,num);
        System.out.println(num+"在数组中出现的次数为："+count);
    }

    public static int count(int[] arr, int num){
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if(num == arr[i]){
                count++;
            }
        }
        return count;
    }
}
